using Microsoft.SPOT;
using System;

namespace Gadgeteer.Interfaces.Graphics
{
    public interface ISimpleGraphics
    {
        /// <summary>
        /// Gets or sets a value that indicates whether the display should automatcially
        /// refresh after it has been issued a drawing command.
        /// </summary>
        /// <remarks>
        /// Set this property to false and use the Gadgeteer.Modules.Module.DisplayModule.SimpleGraphicsInterface.Redraw()
        /// method to improve performance when displaying mutiple shapes or lines of
        /// text at the same time. When Gadgeteer.Modules.Module.DisplayModule.SimpleGraphicsInterface.AutoRedraw
        /// is false, display operations do not render until you call the Gadgeteer.Modules.Module.DisplayModule.SimpleGraphicsInterface.Redraw()
        /// method.
        /// </remarks>
        bool AutoRedraw { get; set; }

        /// <summary>
        /// Gets or sets the background color for the display.
        /// </summary>
        Color BackgroundColor { get; set; }

        /// <summary>
        /// Gets the height of this display.
        /// </summary>
        uint Height { get; }
        
        /// <summary>
        /// Gets the width of this display.
        /// </summary>
        uint Width { get; }

        void DisplayImage(Picture picture, uint x, uint y);

        void DisplayText(string text, Font font, Color color, uint x, uint y);


        /// <summary>
        /// Clears the display, but does not redraw it.
        /// </summary>
        void ClearNoRedraw();

        /// <summary>
        ///  Clears the display and (if Gadgeteer.Modules.Module.DisplayModule.SimpleGraphicsInterface.AutoRedraw is true), redraws it.
        /// </summary>
        void Clear();

        /// <summary>
        /// Retrieves the pixel color at a specified location on the display.
        /// </summary>
        /// <param name="x">The x-coordinate of the location where pixel color is to be retrieved.</param>
        /// <param name="y">The y-coordinate of the location where pixel color is to be retrieved.</param>
        /// <returns>The pixel color at the specified location.</returns>
        Color GetPixel(int x, int y);

        /// <summary>
        ///  Sets a specified pixel to the specified color.
        /// </summary>
        /// <param name="color">The color to set the pixel to.</param>
        /// <param name="x">The X cooridinate of the pixel.</param>
        /// <param name="y">The Y cooridinate of the pixel.</param>
        void SetPixel(Color color, uint x, uint y);
    }
}
